package com.scott.ch010;

import java.util.ArrayList;

/**
 * @author 黄后林
 * @version 1.0
 * @note
 * @date 2021-12-18 13:50:13
 */
public class RoleService {


    public static void main(String[] args) {

        ArrayList list = new ArrayList();
        list.add("hy");
        list.add(23);

        for (int index = 0; index < list.size(); index++) {
            Object object = list.get(index);

            // 在循环中拿第1个元素的值
            String name= (String)object;
            System.out.println(name);

        }
    }


}
